package com.ny.zmb.glxt.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ny.zmb.glxt.entity.PmAm;
import com.ny.zmb.glxt.service.IPmAmService;
import com.ny.zmb.openapi.entity.DataResult;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 申请 高级别返利 或 分类代理 的表 前端控制器
 * </p>
 *
 * @author xie
 * @since 2024-10-22
 */
@RestController
@RequestMapping("/glxt/pmAm")
@CrossOrigin
public class PmAmController {



    @Resource
    private IPmAmService iPmAmService;

    @RequestMapping("getList")
    public IPage<PmAm> index(
            PmAm pmAm,
            @RequestParam(defaultValue = "1") int currentPage,
            @RequestParam(defaultValue = "10") int pageSize
    ){

        IPage<PmAm> page = new Page<>(currentPage, pageSize);
        QueryWrapper<PmAm> pmStoreQueryWrapper = new QueryWrapper<>(pmAm);
        return iPmAmService.getPageList(page,pmStoreQueryWrapper);

    }
    //平台 高级别返利审核
    @RequestMapping("sh")
    public DataResult<PmAm> sh(
            PmAm pmAm
    ){

        return iPmAmService.sh(pmAm);

    }

}
